package com.jesper.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.jesper.mapper.PropertyMapper;
import com.jesper.model.Property;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PropertyService extends ServiceImpl<PropertyMapper, Property> {
    @Autowired
    PropertyMapper propertyMapper;

    public List<Property> getListById(Long id) {
        QueryWrapper<Property> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("item_id", id);

        List<Property> property = propertyMapper.selectList(queryWrapper);
        return property;
    }


    public Property getById(Long id) {
        Property property = new Property();
        property = this.baseMapper.selectById(id);
        return property;
    }

    public Long getItemId(Long id) {
        Long itemId = this.baseMapper.getItemId(id);
        return itemId;
    }


}
